﻿namespace Pdf2epub.Epub
{
    public class EpubFiles
    {
        private string m_ContainerFolder;
        private string m_ContentFolder;

        /// <summary>
        /// Initalizes default values
        /// </summary>
        public EpubFiles(EpubDirectories epubDirectories)
        {
            UpdateBaseDirectories(epubDirectories);
            TitleFile = "title.xml";
            NcxFile = "toc.ncx";
            OpfFile = "content.opf";
        }

        public string ContainerFile { get { return "container.xml"; } }

        public string ContainerFileFullPath { get { return EpubHelper.CombinePath(m_ContainerFolder, ContainerFile); } }

        public string NcxFile { get; set; }

        public string NcxFileFullPath { get { return EpubHelper.CombinePath("", NcxFile); } }

        public string OpfFile { get; set; }

        public string OpfFileFullPath { get { return EpubHelper.CombinePath("", OpfFile).Trim('/'); } }

        public string TitleFile { get; set; }

        public string TitleFileFullPath { get { return EpubHelper.CombinePath(m_ContentFolder, TitleFile); } }

        public void UpdateBaseDirectories(EpubDirectories epubDirectories)
        {
            m_ContainerFolder = epubDirectories.MetaInfFolder;
            m_ContentFolder = epubDirectories.ContentFolder;
        }
    }
}